import Vue from "vue";
import VueRouter from "vue-router";
import zyh from "../router/zyh";
import li from "../router/li";
import ma from "../router/ma";
import zhoutong from "../router/zhoutong";
import miao from "../router/miao";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    redirect: "/startup",
  },
  {
    path: "/login",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/Login.vue"),
  },
  {
    path: "/startup",
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/Startup.vue"),
  },
  {
    path: "/home",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/Home.vue"),
    children: [
      { path: "/home", redirect: "/home/practice" },
      {
        path: "/home/practice",
        component: () =>
          import(/* webpackChunkName: "about" */ "../views/home/Practice.vue"),
      },
      {
        path: "/home/self",
        component: () =>
          import(/* webpackChunkName: "about" */ "../views/home/Self.vue"),
      },
      {
        path: "/home/found",
        component: () =>
          import(/* webpackChunkName: "about" */ "../views/home/Found.vue"),
      },
      {
        path: "/home/my",
        component: () =>
          import(/* webpackChunkName: "about" */ "../views/home/My.vue"),
      },
      {
        path: "/home/my/a",
        // name: "a",
        // name: "/home/my/a",
        component: () =>
          import(/* webpackChunkName: "about" */ "../views/home/my/A.vue"),
      },
    ],
  },

  //引入
  ...li,
  ...zyh,
  ...ma,
  ...zhoutong,
  ...miao,
];

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes,
});

export default router;
